@extends('layouts.default') @section('main')
<link rel="stylesheet" href="{{URL::asset('js/')}}/kindeditor-4.1.7/themes/default/default.css" />
<link rel="stylesheet" href="{{URL::asset('js/')}}/kindeditor-4.1.7/plugins/code/prettify.css" />
<script src="{{URL::asset('js/')}}/kindeditor-4.1.7/kindeditor.js" type="text/javascript"></script> 
<script charset="utf-8" src="{{URL::asset('js/')}}/kindeditor-4.1.7/lang/zh_CN.js"></script> 
<script charset="utf-8" src="{{URL::asset('js/')}}/kindeditor-4.1.7/plugins/code/prettify.js"></script>
<script type="text/javascript" src="{{URL::asset('js/')}}/ajaxfileupload.js"></script>
<script type="text/javascript" src="{{URL::asset('js/')}}/common.js"></script>
<script src="{{URL::asset('js/My97DatePicker/')}}/WdatePicker.js"></script> 
<script>
KindEditor.ready(function(K) {

		var editor1 = K.create('#activity_content,#activity_description', {
			uploadJson: "{{url('kindedit/upload')}}",
			fileManagerJson: "{{url('kindedit/manager')}}",
			allowFileManager: true,
			afterBlur: function() {
				this.sync();
			},
			items: ['source', '|', 'undo', 'redo', '|', 'cut', 'copy', 'paste', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript', 'superscript', 'clearhtml', 'quickformat', 'selectall', 'image', '/', 'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'table', 'hr', 'emoticons', 'pagebreak', 'anchor', 'link', 'unlink', '|'],
			readonlyMode : true
		});
		
});
</script>
<div id="content">
	<div id="content-header">
		<div id="breadcrumb">
			<a href="{{url('home')}}" title="返回首页" class="tip-bottom"><i
				class="icon-home"></i> 首页</a> <a href="{{url('activityprojectvideo/index')}}"
				class="tip-bottom">活动视频管理</a> <a href="#" class="current">活动视频详情</a>
		</div>
	</div>
	<div class="container-fluid">
		<div class="row-fluid">
			<div class="span9">
				<div class="widget-box">
					<div class="widget-title">
						<span class="icon"> <i class="icon-align-justify"></i>
						</span>
						<h5>活动视频详情</h5>
					</div>
					<div class="widget-content nopadding">
						<form action="{{url('activityprojectvideo/update')}}" method="post"
							class="form-horizontal" id="activityForm">
							<div class="control-group">
								<label class="control-label">活动名称 :</label>
								<div class="controls">
									<select name="activity_id" class="span11" id="activity" disabled="disabled">
									<option value="">请选择</option>
										@foreach($activities as $activity)
					                  <option value="{{$activity->id}}" <?php if($video->activity_id == $activity->id):?>selected="selected"<?php endif;?>>{{$activity->subject}}</option>
					                  	@endforeach
					                </select>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">项目名称 :</label>
								<div class="controls">
									<select name="project_id" class="span11" disabled="disabled" id="project">
									<option value="">请选择</option>
					                </select>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">视频地址 :</label>
								<div class="controls">
									<input type="text" class="span11" name="path" disabled="disabled" value="{{$video->path}}"
										placeholder="视频地址" />
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">APP视频地址 :</label>
								<div class="controls">
									<input type="text" class="span11" name="app_path" disabled="disabled" value="{{$video->app_path}}"
										placeholder="APP视频地址" />
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">标题 :</label>
								<div class="controls">
									<input type="text" class="span11" name="subject" disabled="disabled" value="{{$video->subject}}"
										placeholder="标题" />
								</div>
							</div>
							{{--<div class="control-group">--}}
								{{--<label class="control-label">副标题 :</label>--}}
								{{--<div class="controls">--}}
									{{--<input type="text" class="span11" name="title" disabled="disabled" value="{{$video->title}}"--}}
										{{--placeholder="副标题" />--}}
								{{--</div>--}}
							{{--</div>--}}
							<div class="control-group">
								<label class="control-label">视频图片 :</label>
								<div class="controls">
									<input type="text" class="span11" name="image" disabled="disabled" value="{{$video->image}}"
										placeholder="视频图片" />
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">发布时间 :</label>
								<div class="controls">
									<input type="text" class="span11" name="pubdate" disabled="disabled" value="{{date('Y-m-d H:i:s',$video->pubdate)}}" onfocus="WdatePicker({startDate:'%y-%M-01 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:true})"
										placeholder="发布时间" />
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">描述 :</label>
								<div class="controls">
									<textarea id="activity_description" name="description" style="width: 450px; height: 240px;">{{$video->description}}</textarea>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">内容 :</label>
								<div class="controls">
									<textarea id="activity_content" name="content" style="width: 450px; height: 240px;">{{$video->content}}</textarea>
								</div>
							</div>
							{{--<div class="control-group">--}}
								{{--<label class="control-label">二维码地址 :</label>--}}
								{{--<div class="controls">--}}
									{{--<input type="text" class="span11" name="qrcode" disabled="disabled" value="{{$video->qrcode}}"--}}
										{{--placeholder="二维码地址" />--}}
								{{--</div>--}}
							{{--</div>--}}
							{{--<div class="control-group">--}}
								{{--<label class="control-label">播放量 :</label>--}}
								{{--<div class="controls">--}}
									{{--<input type="text" class="span11" name="views" disabled="disabled" value="{{$video->views}}"--}}
										{{--placeholder="播放量" />--}}
								{{--</div>--}}
							{{--</div>--}}
							{{--<div class="control-group">--}}
								{{--<label class="control-label">视频时长 :</label>--}}
								{{--<div class="controls">--}}
									{{--<input type="text" class="span11" name="times" disabled="disabled" value="{{$video->times}}"--}}
										{{--placeholder="视频时长" />--}}
								{{--</div>--}}
							{{--</div>--}}
							<div class="control-group">
								<label class="control-label">点赞 :</label>
								<div class="controls">
									<input type="text" class="span11" name="likes" disabled="disabled" value="{{$video->likes}}"
										placeholder="点赞" />
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">点击量 :</label>
								<div class="controls">
									<input type="text" class="span11" name="click_views" disabled="disabled" value="{{$video->click_views}}"
										placeholder="点击量" />
								</div>
							</div>
                            <div class="control-group">
                                <label class="control-label">排序 :</label>
                                <div class="controls">
                                    <input type="text" class="span11" name="sort" value="{{$video->sort}}"
                                           placeholder="排序" readonly />
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label">是否热门 :</label>
                                <div class="controls">
                                    <input type="radio"  name="hot" disabled  value="1" @if($video->hot==1)checked="checked"@endif/>热门
                                    <input type="radio"  name="hot" disabled value="0" @if($video->hot==0)checked="checked"@endif />不热门
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label">是否置顶 :</label>
                                <div class="controls">
                                    <input type="radio"  name="top" disabled  value="1" @if($video->top==1)checked="checked"@endif/>置顶
                                    <input type="radio"  name="top" disabled value="0" @if($video->top==0)checked="checked"@endif />不置顶
                                </div>
                            </div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script>
var activity_id = {{$video->activity_id}};
var project_id = {{$video->project_id}};
if(activity_id > 0){
	$.post("{{url('activityprojectvideo/activityprojects')}}", {
		aid: activity_id
	}, function(data) {
		if (data.status) {
			var html = '<option value="">请选择</option>';
			$.each(data.message, function(i, n) {
				var selected = project_id == n.id ? 'selected="selected"' : '';
				html += "<option value='"+n.id+"' "+selected+">"+n.subject+"</option>";
			});
			$("#project").html(html);
		}
	}, 'json');
}
</script>
@stop
